﻿@using GTAuto.DAL.DAL
@using GTAuto.DAL.Enums
@{
    int count = 0;
    var brands = DALBrands.Singleton.GetByType(BrandTypeEnum.Auto, 1, 10000, out  count);
    var ulCount = count / 4;
    if (count % 4 > 0) { ulCount = ulCount + 1; }
    int index = 0;
}
<div id="catalog">
@for (int i = 0; i < ulCount; i++)
{
    <ul>
        @for (int j = 0; j < 4 && j < count && index < count; j++)
        {
            
            <li><a href=@Url.Action("Index", "AutoBrands", new { @id = @brands[index].Id })><span class="open_sity"></span>
                 <img src=@Url.Action("GetInSize9971", "Img", new { @id = brands[index].LogoPath }) /> 
                    @brands[index].Name </a></li>
            index++;
        }
    </ul>
}

</div>